/**
 * OCLC, Inc.
 *
 * OCLC proprietary information: the enclosed materials contain
 * proprietary information of OCLC Online Computer Library Center, Inc.
 * and shall not be disclosed in whole or in any part to any third party
 * or used by any person for any purpose, without written consent of
 * OCLC, Inc.  Duplication of any portion of these materials shall
 * include this legend.
 *
 * UnMarshallTest
 *
 * @author Jackie Gleason
 * @version 1.0
 */
package org.oclc.presentations.tests
import org.junit.Test
import org.oclc.presentations.nonetransient.PlayerNoneJava
import javax.xml.bind.JAXBContext
import javax.xml.bind.Unmarshaller
import org.oclc.presentations.nonetransient.PlayerNone

class UnMarshallTest {
    String xmlString = """
    <PoolPlayer name="Fast Edie">
        <PoolRank>2</PoolRank>
        <PlayerID>15</PlayerID>
    </PoolPlayer>
    """
    @Test
    public void testJava(){
        StringReader reader = new StringReader(xmlString);
        JAXBContext context = JAXBContext.newInstance(PlayerNoneJava)
        Unmarshaller m = context.createUnmarshaller()
        PlayerNoneJava player = (PlayerNoneJava) m.unmarshal(reader)
        println("Wath out its... ${player.name}")
    }
    @Test
    public void testGroovy(){
        StringReader reader = new StringReader(xmlString);
        JAXBContext context = JAXBContext.newInstance(PlayerNone)
        Unmarshaller m = context.createUnmarshaller()
        PlayerNone player = (PlayerNone) m.unmarshal(reader)
        println("Wath out its... ${player.name}")
    }
}
